package com.jy.project.enums;

public enum RequiredTypeEnum {
    IS_REQUIRED(1,"必填"),
    NOT_REQUIRED(0,"选填");

    private  Integer  code;

    private  String  value;

    RequiredTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static  String getValue(Integer code){
        for (RequiredTypeEnum value : values()) {
            if (value.getCode().equals(code)){
                return  value.getValue();
            }
        }
        return null;
    }
}
